package com.zhuoyue.biz.core.command.cmd.common.fe6.base;

/**
 * 空调开关
 * @author Administrator
 */
public enum AcSwitchEnum {
    /**
     * 空调开
     */
    ON("ON", "01"),
    /**
     * 空调关
     */
    OFF("OFF", "02");

    private String name;
    private String value;

    AcSwitchEnum(String name, String value) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getValueByName(String name) {
        AcSwitchEnum[] values = AcSwitchEnum.values();
        for (AcSwitchEnum acSwitch : values) {
            if (acSwitch.name.equalsIgnoreCase(name)) {
                return acSwitch.getValue();
            }
        }
        return "FF";
    }

    public static String getNameByValue(String value) {
        AcSwitchEnum[] values = AcSwitchEnum.values();
        for (AcSwitchEnum acSwitch : values) {
            if (acSwitch.value.equalsIgnoreCase(value)) {
                return acSwitch.getName();
            }
        }
        return "出错";
    }
}
